<?php
    // 根据前段传递id，返回对应文章数据接口

    include_once '../../fn.php';

    $id = $_GET['id'];

    // 构造sql执行串
    $sql = "select * from posts where id = $id";

    $result = my_query($sql)[0];

    echo json_encode($result);
?>